

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>l5kit.rasterization package &mdash; L5Kit 1.0.0 documentation</title>
  

  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

  
  
  
  

  
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/language_data.js"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html" class="icon icon-home" alt="Documentation Home"> L5Kit
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="../README.html">ML Prediction, Planning and Simulation for Self-Driving</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#examples">Examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#news">News</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#overview">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#installation">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#credits">Credits</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#contact">Contact</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api_reference.html">API Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../data_format.html">Dataset Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="../how_to_contribute.html">How to contribute</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">L5Kit</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
        
      <li>l5kit.rasterization package</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../_sources/API/l5kit.rasterization.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="module-l5kit.rasterization">
<span id="l5kit-rasterization-package"></span><h1>l5kit.rasterization package<a class="headerlink" href="#module-l5kit.rasterization" title="Permalink to this headline">¶</a></h1>
<dl class="py class">
<dt id="l5kit.rasterization.BoxRasterizer">
<em class="property">class </em><code class="sig-prename descclassname">l5kit.rasterization.</code><code class="sig-name descname">BoxRasterizer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">raster_size</span><span class="p">:</span> <span class="n">Tuple<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">pixel_size</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">ego_center</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">filter_agents_threshold</span><span class="p">:</span> <span class="n">float</span></em>, <em class="sig-param"><span class="n">history_num_frames</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span><a class="headerlink" href="#l5kit.rasterization.BoxRasterizer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="l5kit.rasterization.rasterizer.html#l5kit.rasterization.rasterizer.Rasterizer" title="l5kit.rasterization.rasterizer.Rasterizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">l5kit.rasterization.rasterizer.Rasterizer</span></code></a></p>
<dl class="py method">
<dt id="l5kit.rasterization.BoxRasterizer.rasterize">
<code class="sig-name descname">rasterize</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">history_frames</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">all_agents</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">agent</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>numpy.ndarray<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.BoxRasterizer.rasterize" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="l5kit.rasterization.BoxRasterizer.to_rgb">
<code class="sig-name descname">to_rgb</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">in_im</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">dict</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.BoxRasterizer.to_rgb" title="Permalink to this definition">¶</a></dt>
<dd><p>get an rgb image where agents further in the past have faded colors</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>in_im</strong> – the output of the rasterize function</p></li>
<li><p><strong>kwargs</strong> – this can be used for additional customization (such as colors)</p></li>
</ul>
</dd>
</dl>
<p>Returns: an RGB image with agents and ego coloured with fading colors</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="l5kit.rasterization.CombineRasterizer">
<em class="property">class </em><code class="sig-prename descclassname">l5kit.rasterization.</code><code class="sig-name descname">CombineRasterizer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">rasterizers</span><span class="p">:</span> <span class="n">List<span class="p">[</span><a class="reference internal" href="l5kit.rasterization.rasterizer.html#l5kit.rasterization.rasterizer.Rasterizer" title="l5kit.rasterization.rasterizer.Rasterizer">l5kit.rasterization.rasterizer.Rasterizer</a><span class="p">]</span></span></em>, <em class="sig-param"><span class="n">to_rgb_fn</span><span class="p">:</span> <span class="n">Callable</span></em><span class="sig-paren">)</span><a class="headerlink" href="#l5kit.rasterization.CombineRasterizer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="l5kit.rasterization.rasterizer.html#l5kit.rasterization.rasterizer.Rasterizer" title="l5kit.rasterization.rasterizer.Rasterizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">l5kit.rasterization.rasterizer.Rasterizer</span></code></a></p>
<p>This rasterizer combines multiple rasterizers’ output.</p>
<dl class="py method">
<dt id="l5kit.rasterization.CombineRasterizer.rasterize">
<code class="sig-name descname">rasterize</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">history_frames</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">all_agents</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">agent</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>numpy.ndarray<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.CombineRasterizer.rasterize" title="Permalink to this definition">¶</a></dt>
<dd><p>Rasterize the history wrt to the first element in history_frames (most recent).
This concatenates the rasters on the colour channel dimension.</p>
</dd></dl>

<dl class="py method">
<dt id="l5kit.rasterization.CombineRasterizer.to_rgb">
<code class="sig-name descname">to_rgb</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">in_im</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">dict</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.CombineRasterizer.to_rgb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="l5kit.rasterization.Rasterizer">
<em class="property">class </em><code class="sig-prename descclassname">l5kit.rasterization.</code><code class="sig-name descname">Rasterizer</code><a class="headerlink" href="#l5kit.rasterization.Rasterizer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">abc.ABC</span></code></p>
<p>Base class for something that takes a single state of the world, and outputs a (multi-channel) image.</p>
<dl class="py method">
<dt id="l5kit.rasterization.Rasterizer.rasterize">
<em class="property">abstract </em><code class="sig-name descname">rasterize</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">history_frames</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">all_agents</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">agent</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>numpy.ndarray<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.Rasterizer.rasterize" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="l5kit.rasterization.Rasterizer.to_rgb">
<em class="property">abstract </em><code class="sig-name descname">to_rgb</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">in_im</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">dict</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.Rasterizer.to_rgb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="l5kit.rasterization.SatBoxRasterizer">
<em class="property">class </em><code class="sig-prename descclassname">l5kit.rasterization.</code><code class="sig-name descname">SatBoxRasterizer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">raster_size</span><span class="p">:</span> <span class="n">Tuple<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">pixel_size</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">ego_center</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">filter_agents_threshold</span><span class="p">:</span> <span class="n">float</span></em>, <em class="sig-param"><span class="n">history_num_frames</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">map_im</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">map_to_sat</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">interpolation</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#l5kit.rasterization.SatBoxRasterizer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="l5kit.rasterization.rasterizer.html#l5kit.rasterization.rasterizer.Rasterizer" title="l5kit.rasterization.rasterizer.Rasterizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">l5kit.rasterization.rasterizer.Rasterizer</span></code></a></p>
<p>Combine a Satellite and a Box Rasterizers into a single class</p>
<dl class="py method">
<dt id="l5kit.rasterization.SatBoxRasterizer.rasterize">
<code class="sig-name descname">rasterize</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">history_frames</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">all_agents</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">agent</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>numpy.ndarray<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.SatBoxRasterizer.rasterize" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="l5kit.rasterization.SatBoxRasterizer.to_rgb">
<code class="sig-name descname">to_rgb</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">in_im</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">dict</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.SatBoxRasterizer.to_rgb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="l5kit.rasterization.SatelliteRasterizer">
<em class="property">class </em><code class="sig-prename descclassname">l5kit.rasterization.</code><code class="sig-name descname">SatelliteRasterizer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">raster_size</span><span class="p">:</span> <span class="n">Tuple<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">pixel_size</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">ego_center</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">map_im</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">map_to_sat</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">interpolation</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#l5kit.rasterization.SatelliteRasterizer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="l5kit.rasterization.rasterizer.html#l5kit.rasterization.rasterizer.Rasterizer" title="l5kit.rasterization.rasterizer.Rasterizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">l5kit.rasterization.rasterizer.Rasterizer</span></code></a></p>
<p>This rasterizer takes a satellite image in its constructor and a transform from world coordinates to this image.
When you call rasterize, it will return a crop around the agent of interest with the agent’s forward vector
pointing right for the current timestep.</p>
<dl class="py method">
<dt id="l5kit.rasterization.SatelliteRasterizer.rasterize">
<code class="sig-name descname">rasterize</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">history_frames</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">all_agents</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">agent</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>numpy.ndarray<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.SatelliteRasterizer.rasterize" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="l5kit.rasterization.SatelliteRasterizer.to_rgb">
<code class="sig-name descname">to_rgb</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">in_im</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">dict</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.SatelliteRasterizer.to_rgb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="l5kit.rasterization.SemBoxRasterizer">
<em class="property">class </em><code class="sig-prename descclassname">l5kit.rasterization.</code><code class="sig-name descname">SemBoxRasterizer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">raster_size</span><span class="p">:</span> <span class="n">Tuple<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">pixel_size</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">ego_center</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">filter_agents_threshold</span><span class="p">:</span> <span class="n">float</span></em>, <em class="sig-param"><span class="n">history_num_frames</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">semantic_map</span><span class="p">:</span> <span class="n">dict</span></em>, <em class="sig-param"><span class="n">pose_to_ecef</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em><span class="sig-paren">)</span><a class="headerlink" href="#l5kit.rasterization.SemBoxRasterizer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="l5kit.rasterization.rasterizer.html#l5kit.rasterization.rasterizer.Rasterizer" title="l5kit.rasterization.rasterizer.Rasterizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">l5kit.rasterization.rasterizer.Rasterizer</span></code></a></p>
<p>Combine a Semantic Map and a Box Rasterizers into a single class</p>
<dl class="py method">
<dt id="l5kit.rasterization.SemBoxRasterizer.rasterize">
<code class="sig-name descname">rasterize</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">history_frames</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">all_agents</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">agent</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>numpy.ndarray<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.SemBoxRasterizer.rasterize" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="l5kit.rasterization.SemBoxRasterizer.to_rgb">
<code class="sig-name descname">to_rgb</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">in_im</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">dict</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.SemBoxRasterizer.to_rgb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="l5kit.rasterization.SemanticRasterizer">
<em class="property">class </em><code class="sig-prename descclassname">l5kit.rasterization.</code><code class="sig-name descname">SemanticRasterizer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">raster_size</span><span class="p">:</span> <span class="n">Tuple<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">pixel_size</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">ego_center</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">semantic_map</span><span class="p">:</span> <span class="n">dict</span></em>, <em class="sig-param"><span class="n">pose_to_ecef</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em><span class="sig-paren">)</span><a class="headerlink" href="#l5kit.rasterization.SemanticRasterizer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="l5kit.rasterization.rasterizer.html#l5kit.rasterization.rasterizer.Rasterizer" title="l5kit.rasterization.rasterizer.Rasterizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">l5kit.rasterization.rasterizer.Rasterizer</span></code></a></p>
<p>Rasteriser for the vectorised semantic map (generally loaded from json files).</p>
<dl class="py method">
<dt id="l5kit.rasterization.SemanticRasterizer.rasterize">
<code class="sig-name descname">rasterize</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">history_frames</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">all_agents</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">agent</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>numpy.ndarray<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.SemanticRasterizer.rasterize" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="l5kit.rasterization.SemanticRasterizer.to_rgb">
<code class="sig-name descname">to_rgb</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">in_im</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">dict</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.SemanticRasterizer.to_rgb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="l5kit.rasterization.StubRasterizer">
<em class="property">class </em><code class="sig-prename descclassname">l5kit.rasterization.</code><code class="sig-name descname">StubRasterizer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">raster_size</span><span class="p">:</span> <span class="n">Tuple<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">pixel_size</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">ego_center</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">filter_agents_threshold</span><span class="p">:</span> <span class="n">float</span></em><span class="sig-paren">)</span><a class="headerlink" href="#l5kit.rasterization.StubRasterizer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="l5kit.rasterization.rasterizer.html#l5kit.rasterization.rasterizer.Rasterizer" title="l5kit.rasterization.rasterizer.Rasterizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">l5kit.rasterization.rasterizer.Rasterizer</span></code></a></p>
<p>This rasterizer doesn’t actually do anything, it returns an all-black image. Useful for testing.</p>
<dl class="py method">
<dt id="l5kit.rasterization.StubRasterizer.rasterize">
<code class="sig-name descname">rasterize</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">history_frames</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">all_agents</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">agent</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>numpy.ndarray<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.StubRasterizer.rasterize" title="Permalink to this definition">¶</a></dt>
<dd><p>Rasterize the history wrt to the first element in history_frames (most recent)</p>
</dd></dl>

<dl class="py method">
<dt id="l5kit.rasterization.StubRasterizer.to_rgb">
<code class="sig-name descname">to_rgb</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">in_im</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">dict</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.StubRasterizer.to_rgb" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a completely black image.</p>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt id="l5kit.rasterization.build_rasterizer">
<code class="sig-prename descclassname">l5kit.rasterization.</code><code class="sig-name descname">build_rasterizer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span><span class="p">:</span> <span class="n">dict</span></em>, <em class="sig-param"><span class="n">data_manager</span><span class="p">:</span> <span class="n"><a class="reference internal" href="l5kit.data.local_data_manager.html#l5kit.data.local_data_manager.DataManager" title="l5kit.data.local_data_manager.DataManager">l5kit.data.local_data_manager.DataManager</a></span></em><span class="sig-paren">)</span> &#x2192; <a class="reference internal" href="l5kit.rasterization.rasterizer.html#l5kit.rasterization.rasterizer.Rasterizer" title="l5kit.rasterization.rasterizer.Rasterizer">l5kit.rasterization.rasterizer.Rasterizer</a><a class="headerlink" href="#l5kit.rasterization.build_rasterizer" title="Permalink to this definition">¶</a></dt>
<dd><p>Factory function for rasterizers, reads the config, loads required data and initializes the correct rasterizer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<em>dict</em>) – Config.</p></li>
<li><p><strong>data_manager</strong> (<a class="reference internal" href="l5kit.data.html#l5kit.data.DataManager" title="l5kit.data.DataManager"><em>DataManager</em></a>) – Datamanager that is used to require files to be present.</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><ul class="simple">
<li><p><strong>NotImplementedError</strong> – Thrown when the <code class="docutils literal notranslate"><span class="pre">map_type</span></code> read from the config doesn’t have an associated rasterizer</p></li>
<li><p><strong>type in this factory function. If you have custom rasterizers</strong><strong>, </strong><strong>you can wrap this function in your own factory</strong> – </p></li>
<li><p><strong>function and catch this error.</strong> – </p></li>
</ul>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Rasterizer initialized given the supplied config.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#l5kit.rasterization.Rasterizer" title="l5kit.rasterization.Rasterizer">Rasterizer</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="l5kit.rasterization.get_sat_image_crop">
<code class="sig-prename descclassname">l5kit.rasterization.</code><code class="sig-name descname">get_sat_image_crop</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sat_image</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">crop_size</span><span class="p">:</span> <span class="n">Union<span class="p">[</span>Tuple<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span><span class="p">, </span>numpy.ndarray<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">sat_pixel_translation</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">yaw</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>float<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.get_sat_image_crop" title="Permalink to this definition">¶</a></dt>
<dd><p>Crops input satellite such that <code class="docutils literal notranslate"><span class="pre">sat_pixel_translation</span></code> is centered in the image.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sat_image</strong> (<em>np.ndarray</em>) – satellite image</p></li>
<li><p><strong>crop_size</strong> (<em>Union</em><em>[</em><em>Tuple</em><em>[</em><em>int</em><em>, </em><em>int</em><em>]</em><em>, </em><em>np.ndarray</em><em>]</em>) – size of desired crop in pixels</p></li>
<li><p><strong>sat_pixel_translation</strong> (<em>np.ndarray</em>) – 2D or 3D vector where to center the cropped image in pixels.</p></li>
</ul>
</dd>
<dt class="field-even">Keyword Arguments</dt>
<dd class="field-even"><p><strong>yaw</strong> (<em>Optional</em><em>[</em><em>float</em><em>]</em>) – yaw in radians, None or 0 means no rotation is applied to the output image.
default: {None})</p>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>a crop of input <code class="docutils literal notranslate"><span class="pre">sat_image</span></code></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>(np.ndarray)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="l5kit.rasterization.get_sat_image_crop_scaled">
<code class="sig-prename descclassname">l5kit.rasterization.</code><code class="sig-name descname">get_sat_image_crop_scaled</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sat_image</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">crop_size</span><span class="p">:</span> <span class="n">Union<span class="p">[</span>Tuple<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span><span class="p">, </span>numpy.ndarray<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">sat_pixel_translation</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">yaw</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>float<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">sat_pixel_scale</span><span class="p">:</span> <span class="n">float</span> <span class="o">=</span> <span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">pixel_size</span><span class="p">:</span> <span class="n">float</span> <span class="o">=</span> <span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">interpolation</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">1</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.get_sat_image_crop_scaled" title="Permalink to this definition">¶</a></dt>
<dd><dl class="simple">
<dt>Calls <cite>get_sat_image_crop</cite> (see that function’s docs for further details), and rescales taking</dt><dd><p>into account a desired pixel size.</p>
</dd>
</dl>
<p class="rubric">Example</p>
<p>Desired <code class="docutils literal notranslate"><span class="pre">crop_size</span></code> is 200x200, and <code class="docutils literal notranslate"><span class="pre">pixel_size</span></code> is 0.5: we want an image that corresponds
to 100x100 meters. This means it extracts a 33x33 image and scales it up to 200x200.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sat_image</strong> (<em>np.ndarray</em>) – satellite image</p></li>
<li><p><strong>crop_size</strong> (<em>Union</em><em>[</em><em>Tuple</em><em>[</em><em>int</em><em>, </em><em>int</em><em>]</em><em>, </em><em>np.ndarray</em><em>]</em>) – size of desired crop in pixels</p></li>
<li><p><strong>sat_pixel_translation</strong> (<em>np.ndarray</em>) – 2D or 3D vector where to center the cropped image in pixels.</p></li>
</ul>
</dd>
<dt class="field-even">Keyword Arguments</dt>
<dd class="field-even"><ul class="simple">
<li><p><strong>yaw</strong> (<em>Optional</em><em>[</em><em>float</em><em>]</em>) – yaw in radians, 0 means no rotation is applied, which generally means up is North.
default: {None})</p></li>
<li><p><strong>sat_pixel_scale</strong> (<em>float</em>) – A <cite>sat_pixel_scale</cite> of 3.0 would means that every pixel in the sat</p></li>
<li><p><strong>corresponds to 3m in the real world.</strong><strong> (</strong><strong>default</strong> (<a class="reference internal" href="l5kit.geometry.image.html#module-l5kit.geometry.image" title="l5kit.geometry.image"><em>image</em></a>) – {1.0})</p></li>
<li><p><strong>pixel_size</strong> (<em>float</em>) – [description] (default: {1.0})</p></li>
<li><p><strong>interpolation</strong> (<em>int</em>) – [description] (default: {cv2.INTER_LINEAR})</p></li>
</ul>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>a crop of input <code class="docutils literal notranslate"><span class="pre">sat_image</span></code></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>(np.ndarray)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="l5kit.rasterization.get_sat_image_crop_scaled_from_ecef">
<code class="sig-prename descclassname">l5kit.rasterization.</code><code class="sig-name descname">get_sat_image_crop_scaled_from_ecef</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sat_image</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">crop_size</span><span class="p">:</span> <span class="n">Union<span class="p">[</span>Tuple<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span><span class="p">, </span>numpy.ndarray<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">ecef_translation</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">ecef_to_sat</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">Any</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.get_sat_image_crop_scaled_from_ecef" title="Permalink to this definition">¶</a></dt>
<dd><p>Utility function, calls get_sat_image_crop_scaled, see that function for more details on additional
keyword arguments (such as <code class="docutils literal notranslate"><span class="pre">yaw</span></code>).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sat_image</strong> (<em>np.ndarray</em>) – satellite image</p></li>
<li><p><strong>crop_size</strong> (<em>Union</em><em>[</em><em>Tuple</em><em>[</em><em>int</em><em>, </em><em>int</em><em>]</em><em>, </em><em>np.ndarray</em><em>]</em>) – size of desired crop in pixels</p></li>
<li><p><strong>ecef_translation</strong> (<em>np.ndarray</em>) – 2D or 3D vector where to center the cropped image</p></li>
<li><p><strong>ecef_to_sat</strong> (<em>np.ndarray</em>) – transform from ECEF to satellite image space</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>np.ndarray – a crop of satellite_image</p>
</dd>
</dl>
</dd></dl>

<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="l5kit.rasterization.box_rasterizer.html">l5kit.rasterization.box_rasterizer module</a></li>
<li class="toctree-l1"><a class="reference internal" href="l5kit.rasterization.combine_rasterizer.html">l5kit.rasterization.combine_rasterizer module</a></li>
<li class="toctree-l1"><a class="reference internal" href="l5kit.rasterization.rasterizer.html">l5kit.rasterization.rasterizer module</a></li>
<li class="toctree-l1"><a class="reference internal" href="l5kit.rasterization.rasterizer_builder.html">l5kit.rasterization.rasterizer_builder module</a></li>
<li class="toctree-l1"><a class="reference internal" href="l5kit.rasterization.sat_box_rasterizer.html">l5kit.rasterization.sat_box_rasterizer module</a></li>
<li class="toctree-l1"><a class="reference internal" href="l5kit.rasterization.satellite_image.html">l5kit.rasterization.satellite_image module</a></li>
<li class="toctree-l1"><a class="reference internal" href="l5kit.rasterization.satellite_rasterizer.html">l5kit.rasterization.satellite_rasterizer module</a></li>
<li class="toctree-l1"><a class="reference internal" href="l5kit.rasterization.sem_box_rasterizer.html">l5kit.rasterization.sem_box_rasterizer module</a></li>
<li class="toctree-l1"><a class="reference internal" href="l5kit.rasterization.semantic_rasterizer.html">l5kit.rasterization.semantic_rasterizer module</a></li>
<li class="toctree-l1"><a class="reference internal" href="l5kit.rasterization.stub_rasterizer.html">l5kit.rasterization.stub_rasterizer module</a></li>
</ul>
</div>
</div>
</div>


           </div>
           
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        
        &copy; Copyright 2020, Lyft Level 5

    </p>
  </div>
    
    
    
    Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>